<!--
   Created by IntelliJ IDEA.
   @File index.html
   @Auth liuxing
   @Date 2021/8/22,10:41
   @Email liuxing997@foxmail.com
-->
<!-- page content -->
<div class="right_col" role="main">
    <div class="">
        <div class="page-title">
            <div class="titlfavicon.icoe_left">
                <h3>
                    Thymeleaf Index Page
                </h3>
            </div>
        </div>

<!--        <div class="clearfix">-->
<!--        </div>-->
<!--        <hr>-->
        <br>
        <h3>Hello World!</h3>
        <p>============ 下载图片 ============</p>
        <a href="/test/file?fileName=阿七.jpeg">下载</a>
        <p>============ 上传图片 ============</p>
        <p th:text="${message}"></p>
        <form action="/test/file" method="post" enctype="multipart/form-data">
            <input type="file" name="file">
            <input type="submit" value="上传">
        </form>
        <p>============ th:text ============</p>
        <span th:text="${name}"></span>
        <div th:text="${name}"></div>

        <p>============ th:if th:unless ============</p>
        <p th:if="${checked} == true">Young People</p>
        <!--如果后面的表达式为false时显示-->
        <p th:unless="${checked} == false">Young People</p>
        <p th:if="${currentNumber}&lt;100">小于100</p>
        <p th:if="${thymeleafTitle} == null">title为null</p>
        <p th:if="${thymeleafTitle} != null">title不为null</p>

        <p>============ 标签属性设置 ============</p>
        <p><input type="checkbox" th:checked="${checked}">checkbox</p>
        <p><img th:src="${src}"></p>
        <p><a th:href="${href}">baidu</a></p>
        <a th:href="@{'/api/city/' + ${city.cityId}}">路径参数</a>
        <a th:href="@{/api/city(cityName=${city.cityName},
			localCityName=${city.localCityName})}">查询参数</a>


        <p>===== th:object=========</p>
        <div th:object="${city}">
            <span th:text="${city.cityName}"></span>
            <span th:text="*{cityName}"></span>
        </div>

        <table>
            <thead>
            <tr>
                <td>ID</td>
                <td>CityName</td>
            </tr>
            </thead>
            <tbody>
            <tr th:each="city :${cities}">
                <td th:text="${city.cityId}"></td>
                <td th:text="${city.cityName}"></td>
            </tr>
            </tbody>
        </table>
        <select>
            <option th:each="city : ${cities}" th:value="${city.cityId}" th:text="${city.cityName}"></option>
        </select>

        <p>============ form表单 ============</p>
        <form action="/api/city" method="post" th:object="${city}">
            <input type="hidden" name="_method" value="PUT">
            <p><input th:value="${city.cityId}" name="cityId"></p>
            <p><input th:value="${city.cityName}" name="cityName"></p>
            <p><input th:value="${city.localCityName}" name="localCityName"></p>
            <p><input type="submit" value="登录"></p>
        </form>
        <p>============ th:replace ============</p>
        <div th:replace="test/temp"></div>
    </div>
</div>
<!-- /page content -->
